package com.dayu.design.行为型.责任链模式;

/**
 * 责任链模式
 * 通过setNextHandler指定下一个执行方法
 * 传入key如果不能匹配则交给下一个handler
 * @author dayu
 * @create 2025-03-27 11:23
 */
public class Demo {
    public static void main(String[] args) {
        Handler handler01=new ConcerteHandler01();
        Handler handler02=new ConcerteHandler02();
        handler01.setNextHandler(handler02);
        handler01.handleRequest("01");
    }
}
